package Example9;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String str=scanner.next();
        if ("".equals(str))
            System.out.println("字符串为null");
        char[] chars = str.toCharArray();
        char tempC=chars[0];
        int count=0;
        StringBuilder sb=new StringBuilder();
        for (char c : chars) {
            if (c == tempC)
                count++;
            else{
                sb.append(count+""+tempC);
                tempC=c;
                count=1;
            }
        }
        sb.append(count+""+tempC);
        System.out.println(sb.toString());
    }
}
